package com.GameInterfaceDevelopment.JCheckBox;
import java.awt.*;
import javax.swing.*;
public class Favorite extends JPanel{
    JCheckBox sport,computer,music,read;
    Favorite(){
        sport = new JCheckBox("运动");
        computer = new JCheckBox("电脑");
        music = new JCheckBox("音乐");
        read = new JCheckBox("阅读");
        //添加新标签
        add(new JLabel("爱好"));

        add(sport);
        add(computer);
        add(music);
        add(read);
        sport.setSelected(false);
        computer.setSelected(false);
        music.setSelected(false);
        read.setSelected(false);
    }
}









































































































































